package com.wuzao.AbstractFactoryPattern.pizzaStore;

import com.wuzao.AbstractFactoryPattern.base.Pizza;
import com.wuzao.AbstractFactoryPattern.base.PizzaFactory;
import com.wuzao.AbstractFactoryPattern.base.PizzaStore;
import com.wuzao.AbstractFactoryPattern.factory.NYPizzaFactory;


/**
 * NY披萨分店
 */
public class NYPizzaStore extends PizzaStore {

    PizzaFactory pizzaFactory;

    public NYPizzaStore(){
        this.pizzaFactory = new NYPizzaFactory();
    }

    public NYPizzaStore(PizzaFactory pizzaFactory){
        this.pizzaFactory = pizzaFactory;
    }

    @Override
    protected Pizza createPizza(String type) {
        return pizzaFactory.createPizza(type);
    }
}
